import 'package:f_base_sy/pages/detail_page.dart';
import 'package:flutter/material.dart';

class HomePage extends StatelessWidget {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('HomePage'),
        ),
        body: const HomePageBody(),
      ),
    );
  }
}

class HomePageBody extends StatelessWidget {
  const HomePageBody({super.key});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        children: [
          const Text('HomePage'),
          ElevatedButton(
            onPressed: () {
              // 跳转详情页
              Navigator.push(context, MaterialPageRoute(builder: (context) {
                return const DetailPage();
              }));
            },
            child: const Text('跳转详情页'),
          ),
        ],
      ),
    );
  }
}
